package com.great.medical.goods.db.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;


@Data
@NoArgsConstructor
@TableName("t_origin_goods")
@ApiModel(value="OriginGoods对象", description="商品仓库")
public class OriginGoods {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "分类id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long classifyId;

    @ApiModelProperty(value = "分类名称")
    @TableField(exist = false)
    private String classifyName;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "开启状态 1:启用,0:禁用")
    private Integer status;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    public Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE, update = "now()")
    public Date modifyTime;


}
